-- Decompiled with the Synapse X Luau decompiler.

local v1 = {};
local function u1(p1)
	local v2 = string.format("%c", p1 % 26 + 65);
	local v3 = math.floor(p1 / 26);
	if v3 > 0 then
		v2 = u1(v3 - 1) .. v2;
	end;
	return v2;
end;
function v1.SetBit(p2, p3)

end;
local v4 = {};
function v1.ToStringWithLetters(p4, p5)
	local v5 = tostring(p5);
	local v6 = string.find(v5, "[.]");
	local v7 = string.find(v5, "[e+]");
	local v8 = string.sub(v5, 1, (v6 or (v7 or #v5 + 1)) - 1);
	local v9 = "";
	local v10 = #v8;
	if v6 then
		v9 = string.sub(v5, v6 + 1, (v7 or #v5 + 1) - 1);
	end;
	if v7 then
		v10 = v10 + tostring((string.sub(v5, v7 + 2, #v5)));
	end;
	local v11 = math.floor((v10 - 1) / 3);
	local v12 = v10 - v11 * 3;
	if v12 < #v8 then
		v9 = string.sub(v8, v12 + 1, #v8) .. v9;
		v8 = string.sub(v8, 1, v12);
	elseif #v8 < v12 then
		local v13 = v12 - #v8;
		v8 = v8 .. string.sub(v9, 1, v13);
		v9 = string.sub(v9, v13 + 1, #v9);
		if #v8 < v12 then
			for v14 = 1, v13 do
				v8 = v8 .. "0";
			end;
		end;
	end;
	if #v9 > 3 then
		v9 = string.sub(v9, 1, 3);
	end;
	while #v9 > 0 and string.sub(v9, #v9, #v9) == "0" do
		v9 = string.sub(v9, 1, #v9 - 1);	
	end;
	local v15 = v8;
	if v9 ~= "" and v9 ~= "000" then
		v15 = v15 .. "." .. v9;
	end;
	return v15 .. u1(v11);
end;
function v1.GetNameStr(p6, p7)
	local v16 = tostring(p7);
	local v17 = string.find(v16, "[.]");
	local v18 = string.find(v16, "[e+]");
	local v19 = string.sub(v16, 1, (v17 or (v18 or #v16 + 1)) - 1);
	local v20 = "";
	local v21 = #v19;
	if v17 then
		v20 = string.sub(v16, v17 + 1, (v18 or #v16 + 1) - 1);
	end;
	if v18 then
		v21 = v21 + tostring((string.sub(v16, v18 + 2, #v16)));
	end;
	local v22 = math.floor((v21 - 1) / 3);
	local v23 = v21 - v22 * 3;
	if v23 < #v19 then
		v20 = string.sub(v19, v23 + 1, #v19) .. v20;
		v19 = string.sub(v19, 1, v23);
	elseif #v19 < v23 then
		local v24 = v23 - #v19;
		v19 = v19 .. string.sub(v20, 1, v24);
		v20 = string.sub(v20, v24 + 1, #v20);
		if #v19 < v23 then
			for v25 = 1, v24 do
				v19 = v19 .. "0";
			end;
		end;
	end;
	if #v20 > 3 then
		v20 = string.sub(v20, 1, 3);
	elseif #v20 < 3 then
		for v26 = 1, 3 - #v20 do
			v20 = v20 .. "0";
		end;
	end;
	return u1(v22) .. v19 .. v20;
end;
local u2 = {
	[0] = {
		bit = 3, 
		name = "", 
		code = ""
	},
	{
		bit = 3, 
		name = "kilo", 
		code = "K"
	}, {
		bit = 6, 
		name = "million", 
		code = "M"
	}, {
		bit = 9, 
		name = "billion", 
		code = "B"
	}, {
		bit = 12, 
		name = "trillion", 
		code = "T"
	}, {
		bit = 15, 
		name = "quadrillion", 
		code = "Qa"
	}, {
		bit = 18, 
		name = "quintillion", 
		code = "Qi"
	}, {
		bit = 21, 
		name = "sextillion", 
		code = "Sx"
	}, {
		bit = 24, 
		name = "septillion", 
		code = "Sp"
	}, {
		bit = 27, 
		name = "octillion", 
		code = "OcT"
	}, {
		bit = 30, 
		name = "nonillion", 
		code = "N"
	}, {
		bit = 33, 
		name = "decillion", 
		code = "D"
	}, {
		bit = 36, 
		name = "undecillion", 
		code = "UnD"
	}, {
		bit = 39, 
		name = "duodecillion", 
		code = "DD"
	}, {
		bit = 42, 
		name = "tredecillion", 
		code = "TD"
	}, {
		bit = 45, 
		name = "quattuordecillion", 
		code = "QtD"
	}, {
		bit = 48, 
		name = "quindecillion", 
		code = "QnD"
	}, {
		bit = 51, 
		name = "sexdecillion", 
		code = "SxD"
	}, {
		bit = 54, 
		name = "septendecillion", 
		code = "SpD"
	}, {
		bit = 57, 
		name = "octodecillion", 
		code = "OcD"
	}, {
		bit = 60, 
		name = "novemdecillion", 
		code = "NoD"
	}, {
		bit = 63, 
		name = "vigintillion", 
		code = "VgN"
	}, {
		bit = 66, 
		name = "unvigintillion", 
		code = "UvG"
	}, {
		bit = 69, 
		name = "duovigintillion", 
		code = "DvG"
	}, {
		bit = 72, 
		name = "trevigintillion", 
		code = "TvG"
	}, {
		bit = 75, 
		name = "quattuorvigintillion", 
		code = "QaV"
	}, {
		bit = 78, 
		name = "quinvigintillion", 
		code = "QiV"
	}, {
		bit = 81, 
		name = "sexvigintillion", 
		code = "SxV"
	}, {
		bit = 84, 
		name = "septenvigintillion", 
		code = "SpV"
	}, {
		bit = 87, 
		name = "octovigintillion", 
		code = "OcV"
	}, {
		bit = 90, 
		name = "novemvigintillion", 
		code = "NvT"
	}, {
		bit = 93, 
		name = "trigintillion", 
		code = "TT"
	}, {
		bit = 96, 
		name = "untrigintillion", 
		code = "UG"
	}, {
		bit = 99, 
		name = "duotrigintillion", 
		code = "DG"
	}, {
		bit = 102, 
		name = "tretrigintillion", 
		code = "TG"
	}, {
		bit = 105, 
		name = "quattuortrigintillion", 
		code = "QG"
	}, {
		bit = 108, 
		name = "quintrigintillion", 
		code = "QuG"
	}, {
		bit = 111, 
		name = "sextrigintillion", 
		code = "SxT"
	}, {
		bit = 114, 
		name = "septentrigintillion", 
		code = "SpT"
	}, {
		bit = 117, 
		name = "octotrigintillion", 
		code = "OgT"
	}, {
		bit = 120, 
		name = "novemtrigintillion", 
		code = "NgT"
	}, {
		bit = 123, 
		name = "quadragintillion", 
		code = "QgT"
	}, {
		bit = 126, 
		name = "unquadragintillion", 
		code = "UgT"
	}, {
		bit = 129, 
		name = "duoquadragintillion", 
		code = "DgT"
	}, {
		bit = 132, 
		name = "trequadragintillion", 
		code = "TgT"
	}, {
		bit = 135, 
		name = "quattuorquadragintillion", 
		code = ""
	}, {
		bit = 138, 
		name = "quinquadragintillion", 
		code = ""
	}, {
		bit = 141, 
		name = "sexquadragintillion", 
		code = ""
	}, {
		bit = 144, 
		name = "septenquadragintillion", 
		code = ""
	}, {
		bit = 147, 
		name = "octoquadragintillion", 
		code = ""
	}, {
		bit = 150, 
		name = "novemquadragintillion", 
		code = ""
	}, {
		bit = 153, 
		name = "quinquagintillion", 
		code = ""
	}, {
		bit = 156, 
		name = "unquinquagintillion", 
		code = ""
	}, {
		bit = 159, 
		name = "duoquinquagintillion", 
		code = ""
	}, {
		bit = 162, 
		name = "trequinquagintillion", 
		code = ""
	}, {
		bit = 165, 
		name = "quattuorquinquagintillion", 
		code = ""
	}, {
		bit = 168, 
		name = "quinquinquagintillion", 
		code = ""
	}, {
		bit = 171, 
		name = "sexquinquagintillion", 
		code = ""
	}, {
		bit = 174, 
		name = "septenquinquagintillion", 
		code = ""
	}, {
		bit = 177, 
		name = "octoquinquagintillion", 
		code = ""
	}, {
		bit = 180, 
		name = "novemquinquagintillion", 
		code = ""
	}, {
		bit = 183, 
		name = "sexagintillion", 
		code = ""
	}, {
		bit = 186, 
		name = "unsexagintillion", 
		code = ""
	}, {
		bit = 189, 
		name = "duosexagintillion", 
		code = ""
	}, {
		bit = 192, 
		name = "tresexagintillion", 
		code = ""
	}, {
		bit = 195, 
		name = "quattuorsexagintillion", 
		code = ""
	}, {
		bit = 198, 
		name = "quinsexagintillion", 
		code = ""
	}, {
		bit = 201, 
		name = "sexsexagintillion", 
		code = ""
	}, {
		bit = 204, 
		name = "septensexagintillion", 
		code = ""
	}, {
		bit = 207, 
		name = "octosexagintillion", 
		code = ""
	}, {
		bit = 210, 
		name = "novemsexagintillion", 
		code = ""
	}, {
		bit = 213, 
		name = "septuagintillion", 
		code = ""
	}, {
		bit = 216, 
		name = "unseptuagintillion", 
		code = ""
	}, {
		bit = 219, 
		name = "duoseptuagintillion", 
		code = ""
	}, {
		bit = 222, 
		name = "treseptuagintillion", 
		code = ""
	}, {
		bit = 225, 
		name = "quattuorseptuagintillion", 
		code = ""
	}, {
		bit = 228, 
		name = "quinseptuagintillion", 
		code = ""
	}, {
		bit = 231, 
		name = "sexseptuagintillion", 
		code = ""
	}, {
		bit = 234, 
		name = "septenseptuagintillion", 
		code = ""
	}, {
		bit = 237, 
		name = "octoseptuagintillion", 
		code = ""
	}, {
		bit = 240, 
		name = "novemseptuagintillion", 
		code = ""
	}, {
		bit = 243, 
		name = "octogintillion", 
		code = ""
	}, {
		bit = 246, 
		name = "unoctogintillion", 
		code = ""
	}, {
		bit = 249, 
		name = "duooctogintillion", 
		code = ""
	}, {
		bit = 252, 
		name = "treoctogintillion", 
		code = ""
	}, {
		bit = 255, 
		name = "quattuoroctogintillion", 
		code = ""
	}, {
		bit = 258, 
		name = "quinoctogintillion", 
		code = ""
	}, {
		bit = 261, 
		name = "sexoctogintillion", 
		code = ""
	}, {
		bit = 264, 
		name = "septenoctogintillion", 
		code = ""
	}, {
		bit = 267, 
		name = "octooctogintillion", 
		code = ""
	}, {
		bit = 270, 
		name = "novemoctogintillion", 
		code = ""
	}, {
		bit = 273, 
		name = "nonagintillion", 
		code = ""
	}, {
		bit = 276, 
		name = "unnonagintillion", 
		code = ""
	}, {
		bit = 279, 
		name = "duononagintillion", 
		code = ""
	}, {
		bit = 282, 
		name = "trenonagintillion", 
		code = ""
	}, {
		bit = 285, 
		name = "quattuornonagintillion", 
		code = ""
	}, {
		bit = 288, 
		name = "quinnonagintillion", 
		code = ""
	}, {
		bit = 291, 
		name = "sexnonagintillion", 
		code = ""
	}, {
		bit = 294, 
		name = "septennonagintillion", 
		code = ""
	}, {
		bit = 297, 
		name = "octononagintillion", 
		code = ""
	}, {
		bit = 300, 
		name = "novemnonagintillion", 
		code = ""
	}, {
		bit = 303, 
		name = "centillion", 
		code = ""
	}
};

function formatNum( numTmp )
    
    local resultNum = numTmp
    if type(numTmp) == "number" then
        local inter, point = math.modf(numTmp)

        local strNum = tostring(inter)
        local newStr = ""
        local numLen = string.len( strNum )
        local count = 0
        for i = numLen, 1, -1 do
            if count % 3 == 0 and count ~= 0  then
                newStr = string.format("%s,%s",string.sub( strNum,i,i),newStr) 
            else
                newStr = string.format("%s%s",string.sub( strNum,i,i),newStr) 
            end
            count = count + 1
        end

        if point > 0 then
            --@desc 存在小数点，
            local strPoint = string.format( "%.2f", point )
            resultNum = string.format("%s%s",newStr,string.sub( strPoint,2, string.len( strPoint ))) 
        else
            resultNum = newStr
        end
    end
    
    return resultNum
end

BB= {"k","M","B","T","qd","Qn","sx","Sp","O","N","de","Ud","DD","tdD","qdD","QnD","sxD","SpD","OcD","NvD","Vgn","UVg","DVg","TVg","qtV","QnV","SeV","SPG","OVG","NVG","TGN","UTG","DTG","tsTG","qtTG","QnTG","ssTG","SpTG","OcTG","NoTG","QdDR","uQDR","dQDR","tQDR","qdQDR","QnQDR","sxQDR","SpQDR","OQDDr","NQDDr","qQGNT","uQGNT","dQGNT","tQGNT","qdQGNT","QnQGNT","sxQGNT","SpQGNT", "OQQGNT","NQQGNT","SXGNTL"}                                              

local function shorten(Input)
	local Negative = Input < 0
	Input = math.abs(Input)

	local Paired = false
	for i,v in pairs(BB) do
		if not (Input >= 10^(3*i)) then
			Input = Input / 10^(3*(i-1))
			local isComplex = (string.find(tostring(Input),".") and string.sub(tostring(Input),4,4) ~= ".")
			Input = string.sub(tostring(Input),1,(isComplex and 4) or 3) .. (BB[i-1] or "")
			Paired = true
			break;
		end
	end
	if not Paired then
		local Rounded = math.floor(Input)
		Input = tostring(Rounded)
	end

	if Negative then
		return "-"..Input
	end
	return Input
end
function v1.ToString(p8, p9)
	if p9<1000000 then
		p9=math.floor(p9*100+0.5)/100
		return formatNum(p9)
	else
		p9=math.floor(p9+0.5)
		return shorten(p9)
	end
end

function v1.ToString_old(p8, p9)
	if p9<1000000 then
		return formatNum(p9)
	end
	
	local numstr = tostring(p9);
	local v28 = string.find(numstr, "[.]");
	local v29 = string.find(numstr, "[e+]");
	local v30 = string.sub(numstr, 1, (v28 or (v29 or #numstr + 1)) - 1);
	local v31 = "";
	local v32 = #v30;
	if v28 then
		v31 = string.sub(numstr, v28 + 1, (v29 or #numstr + 1) - 1);
	end;
	if v29 then
		v32 = v32 + tostring((string.sub(numstr, v29 + 2, #numstr)));
	end;
	local v33 = math.floor((v32 - 1) / 3);
	local v34 = v32 - v33 * 3;
	if v34 < #v30 then
		v31 = string.sub(v30, v34 + 1, #v30) .. v31;
		v30 = string.sub(v30, 1, v34);
	elseif #v30 < v34 then
		local v35 = v34 - #v30;
		v30 = v30 .. string.sub(v31, 1, v35);
		v31 = string.sub(v31, v35 + 1, #v31);
		if #v30 < v34 then
			for v36 = 1, v35 do
				v30 = v30 .. "0";
			end;
		end;
	end;
	if #v31 > 2 then
		v31 = string.sub(v31, 1, 2);
	end;
	while #v31 > 0 and string.sub(v31, #v31, #v31) == "0" do
		v31 = string.sub(v31, 1, #v31 - 1);	
	end;
	local v37 = v30;
	if v31 ~= "" and v31 ~= "00" then
		v37 = v37 .. "." .. v31;
	end;
	return v37 .. (u2[v33] and u2[v33].code or "???");
end;
function v1.ToStringWithLen(p10, p11, p12)
	p12 = p12 and 5;
	local v38 = tostring(p11);
	assert(tonumber(v38), "input is not a number");
	if string.len(v38) < p12 then
		return v38;
	end;
	return p10:ToString(p11);
end;
function v1.TransformDateToString(p13, p14)
	return string.format("%02d:%02d:%02d", p14 / 3600, p14 % 3600 / 60, p14 % 3600 % 60);
end;
return v1;
